package com.nettm.leetcode;

public class ReverseString344 {

    public static void main(String[] args) {
        System.out.println(ReverseString344.reverseString("abcdefg"));
    }

    public static String reverseString(String s) {
        StringBuilder buf = new StringBuilder();
        int length = s.length();
        for (int i = length - 1; i >= 0; i--) {
            buf.append(s.charAt(i));
        }
        return buf.toString();
    }

}
